<template>
	<div class="div">
		<div class="div2">
			<h6>修改个人信息</h6>
			<hr>
			<div class="div3">
			<p>
				<el-input v-model="user.name" placeholder="请输入昵称"></el-input></p>
				<p><el-input v-model="user.phone" placeholder="请输入手机号码"></el-input></p>
				<p><el-input v-model="user.addr" placeholder="请输入收货地址"></el-input></p>
			
			</div>
			<el-button style="background-color: #f56c6c;color: white;"  @click="updatePwd()">确认</el-button>
		</div>
	</div>
</template>

<script>
	export default {
		data(){
			return{
				user:{
					name:'',
					addr:'',
					phone:'',
				}
			}
		},
		methods:{
		updatePwd(){
			let users={
				nickname:this.user.name,
				addr:this.user.phone,
				phone:this.user.addr,
			};
			let fd=new FormData;
			fd.append("nickname",this.user.name);
			fd.append("phone",this.user.phone);
			fd.append("addr",this.user.addr);
			this.$postf("/api/user/updateShip/",fd).then((resp) => {
				console.log(resp.data);
			})
		},
			},
			mounted(){
				this.$get("/api/user/shipInfo").then((resp) => {
					console.log(resp.data);
					this.user=resp.data.data;
				})
			}
		}
		
</script>

<style scoped>
	.div {
		width: 100%;
	}
	.div3 p{
		justify-content: center;
		align-items: center;
		display: flex;
	}
	.div .div2 {
		width: 100%;
		margin-top: 5vh;
		text-align: center;
	}

	.div .div2 hr {
		margin: 0 auto;
		width: 80%;
		border: 1px solid aqua;
	}

	.div .div2 p {
		width: 65%;
		margin: 0 auto;
	}

	.div .div2 p .el-input {
		margin-top: 10vh;
	}
</style>
